﻿#include <MyPlugin/main/ToolBar.h> 
#include <MyPlugin/main/test1_frm_impl.h>
#include <Gocad/gui/gocad/xmmain.h>
#include <Gocad/utils/misc/cstring.h> 

#include "toolbar.moc"

namespace MyPlugin{
	ToolBar::ToolBar(QMainWindow* parent ,const char * name )
		:QToolBar(tr(name), parent)
	{
		// 
		CString LibPath("..\\..\\..\\lib");

		CopyCString filePath(LibPath.string());
		filePath.append("\\pixmaps\\act_1.png");
		QIconSet icon(QPixmap(filePath.string()));
		act_1 = new QAction(icon, tr("ddd"), NULL, this);
		act_1->addTo(this);
		connect(act_1, SIGNAL(activated()), this, SLOT(test_slot()));
	}

	ToolBar::~ToolBar(void)
	{
		delete act_1;
	}

	void ToolBar::test_slot()
	{
		test1_frm_impl *frm = new test1_frm_impl(this);
		if (NULL != frm)
		{
			frm->move( 45, 120 );
			frm->show();
		}
	}
}
